package com.iflytek.cosmo.ocr.common.enums;

public enum LicenseEnum {
	/** 初始状态未激活 */
	INIT("init","初始状态未激活"),
    /** 已被使用 */
    USED("used","已被使用"),
    
    TRIAL("trial","试用"),
    FORMAL("formal","正式"),
    FREE("free","免授权")
    ;
	
	private String code;
    private String desc;

    LicenseEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static LicenseEnum getByCode(String code) {
        if (code == null) {
            return null;
        }

        for (LicenseEnum anEnum : values()) {
            if (anEnum.getCode().equals(code)) {
                return anEnum;
            }
        }

        return null;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
